import request from '../../flow-request';
import { AxiosResponse } from 'axios';
import { ResponseData } from '@/types/api/public';
import { TableList,EditData,InnerFormInput } from '@/types/api/workflow/flowClaim';

type ConfigType<T=ResponseData> = Promise<AxiosResponse<T>>

/**
 * 获取数据
 * @param params 参数
 * @returns 分页数据
 */
export const getData =(params:any):ConfigType<TableList> =>{
    params.pageable={};
    params.pageable.PageNo=params.current;
    params.pageable.PageSize=params.pageSize;
    const data= JSON.stringify(params);
    return request({
        url:'/Api/v1/workflow/tasks/getWaitClaimTasks',
        method:'post',
        data,
        headers: {
            'Content-Type': 'application/json-patch+json'
        }
    })
}

export const doClaim =(params:any):ConfigType =>{
    return request({
       url:'/Api/v1/workflow/tasks/claim',
       method:'post',
       params,   
       headers: {
        'Content-Type': 'application/json'
      } 
    })
  }
